package com.xbongbong.pro.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author 李翔
 * @date 2023/3/9
 * @description
 */
@Getter
public enum ConditionOperatorEnum {
    /**
     *
     */
    OR("或", "or"),
    AND("且", "and")
    ;
    private final String name;

    private final String alias;

    ConditionOperatorEnum(String name, String alias) {
        this.name = name;
        this.alias = alias;
    }

    public static ConditionOperatorEnum getByAlias(String alias) {
        for (ConditionOperatorEnum value : values()) {
            if (Objects.equals(value.getAlias(), alias)) {
                return value;
            }
        }
        return null;
    }
}
